<template>
	<view class="page">
		<image src="https://hzybucket.obs.cn-south-1.myhuaweicloud.com/we_chat/top-bg.png" class="bg-color" mode="aspectFill"></image>
		<!--  refresher-only @onRefresh="onRefresh"    只要下拉 -->
		<z-paging ref="paging" refresher-only @onRefresh="onRefresh" bg-color="rgba(248,248,248,0)">
			<!-- 之后-vue3 -->
			<template #top>
				<uv-navbar bgColor="rgba(0,0,0,0)" autoBack :fixed="false" title="项目详情"></uv-navbar>

				<view class="tab-box">
					<view class="tab-box-content">
						<uv-tabs
							v-if="tabListShow"
							:list="tabList"
							:itemStyle="{ height: '100rpx' }"
							:inactiveStyle="{ color: '#828A9D', fontSize: '28rpx' }"
							:activeStyle="{ color: '#3B75FF', fontSize: '28rpx' }"
							lineColor="#3B75FF"
							@change="tabActiveFunc"
						></uv-tabs>
					</view>
				</view>
			</template>
			<block #refresher="{ refresherStatus }">
				<custom-refresher :status="refresherStatus" />
			</block>
			<!-- 内容 -->
			<view class="content ios">
				<uv-empty
					marginTop="100"
					v-if="!tabData && data.tabActive != 0"
					mode="list"
					icon="https://hzybucket.obs.cn-south-1.myhuaweicloud.com/we_chat/no-msg2.png"
					:text="''"
					textColor="rgba(0,0,0,0)"
				></uv-empty>
				<uv-transition :show="data.tabActive == 0">
					<view class="content-box" v-if="jcxxImteShow">
						<view class="content-box-item" v-if="fieldShowFunc('project_name')">
							<view class="title">项目名称</view>
							<view class="desc">
								{{ detailData.project_name || '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('project_number')">
							<view class="title">项目编号</view>
							<view class="desc">
								{{ detailData.project_number || '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('brand_name')">
							<view class="title">项目品牌</view>
							<view class="desc">{{ detailData.brand_name || '--' }}</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('project_type')">
							<view class="title">项目类型</view>
							<view class="desc">
								<template v-if="detailData.project_type == 1">新店</template>
								<template v-if="detailData.project_type == 2">改造店</template>
								<template v-if="detailData.project_type == 3">翻新店</template>
								<template v-if="detailData.project_type == 4">特批新店</template>
								<template v-if="detailData.project_type == 5">特批改造店</template>
								<template v-if="detailData.project_type == 6">现场对接店</template>
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('survey_site')">
							<view class="title">是否勘场</view>
							<view class="desc">
								<template v-if="detailData.survey_site == 1">无需勘场</template>
								<template v-if="detailData.survey_site == 2">勘场出图</template>
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('area')">
							<view class="title">省市区</view>
							<view class="desc">
								{{ detailData.area || '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('address')">
							<view class="title">详细地址</view>
							<view class="desc">{{ detailData.address || '--' }}</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('account_manager_name')">
							<view class="title">客户经理</view>
							<view class="desc">
								{{ detailData.account_manager_name || '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('display_status')">
							<view class="title">项目进度</view>
							<view class="desc">
								<template v-if="detailData.display_status == 10">待启动</template>
								<template v-if="detailData.display_status == 15">待勘场</template>
								<template v-if="detailData.display_status == 18">待勘场出图</template>
								<template v-if="detailData.display_status == 20">出图中</template>
								<template v-if="detailData.display_status == 25">待报价</template>
								<template v-if="detailData.display_status == 30">洽谈中</template>
								<template v-if="(detailData.display_status == 40 || detailData.display_status > 40) && detailData.display_status != 70">已签约</template>
								<template v-if="detailData.display_status == 42">-待进场</template>
								<template v-if="detailData.display_status == 45">-施工中</template>
								<template v-if="detailData.display_status == 50">-已完工</template>
								<template v-if="detailData.display_status == 55">-待结算</template>
								<template v-if="detailData.display_status == 60">-款项付清</template>
								<template v-if="detailData.display_status == 70">项目取消</template>
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('created_at')">
							<view class="title">创建时间</view>
							<view class="desc">{{ detailData.created_at }}</view>
						</view>
					</view>
				</uv-transition>
				<uv-transition :show="data.tabActive == 1">
					<view class="content-box" v-if="khxxItemShow">
						<view class="content-box-item" v-if="fieldShowFunc('KH_member_id')">
							<view class="title">会员编号</view>
							<view class="desc">{{ tabData.KH_member_id || '--' }}</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('KH_name')">
							<view class="title">客户名称</view>
							<view class="desc">{{ tabData.KH_customer_name || '--' }}</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('KH_phone')">
							<view class="title">联系方式</view>
							<view class="desc">{{ tabData.KH_customer_phone || '--' }}</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('KH_customer_age')">
							<view class="title">年龄</view>
							<view class="desc">
								{{ tabData.KH_customer_age || '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('KH_customer_sex')">
							<view class="title">性别</view>
							<view class="desc">
								<template v-if="tabData.KH_customer_sex == 0">未知</template>
								<template v-if="tabData.KH_customer_sex == 1">男</template>
								<template v-if="tabData.KH_customer_sex == 2">女</template>
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('KH_customer_identity')">
							<view class="title">客户身份</view>
							<view class="desc">
								<template v-if="tabData.KH_customer_identity == 1">老板</template>
								<template v-if="tabData.KH_customer_identity == 2">合伙人</template>
								<template v-if="tabData.KH_customer_identity == 3">项目负责人</template>
								<template v-if="tabData.KH_customer_identity == 0">--</template>
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('KH_customer_type')">
							<view class="title">客户类型</view>
							<view class="desc">
								<template v-if="tabData.KH_customer_type == 1">VIP客户</template>
								<template v-if="tabData.KH_customer_type == 2">优质客户</template>
								<template v-if="tabData.KH_customer_type == 3">普通老客户</template>
								<template v-if="tabData.KH_customer_type == 4">优质新客户</template>
								<template v-if="tabData.KH_customer_type == 5">普通新客户</template>
								<template v-if="tabData.KH_customer_type == 0">--</template>
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('KH_business_area')">
							<view class="title">客户业务区域</view>
							<view class="desc">
								{{ tabData.KH_business_area || '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('KH_customer_attention')">
							<view class="title">对客关注度</view>
							<view class="desc">
								<template v-if="tabData.KH_customer_attention == 1">持续重点关注</template>
								<template v-if="tabData.KH_customer_attention == 2">持续关注</template>
								<template v-if="tabData.KH_customer_attention == 3">定期关注</template>
								<template v-if="tabData.KH_customer_attention == 4">不定期关注</template>
								<template v-if="tabData.KH_customer_attention == 5">一般关注</template>
								<template v-if="tabData.KH_customer_attention == 0">--</template>
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('KH_current_operating_brand')">
							<view class="title">目前经营品牌</view>
							<view class="desc">
								{{ tabData.KH_current_operating_brand || '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('KH_secondary_social_relations')">
							<view class="title">次社会关系</view>
							<view class="desc">
								<template v-if="tabData.KH_secondary_social_relations == 1">品牌方关系户</template>
								<template v-if="tabData.KH_secondary_social_relations == 2">我司关系户</template>
								<template v-if="tabData.KH_secondary_social_relations == 3">政府关系户</template>
								<template v-if="tabData.KH_secondary_social_relations == 4">一般关系</template>
								<template v-if="tabData.KH_secondary_social_relations == 0">--</template>
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('KH_customer_attitude')">
							<view class="title">客户态度</view>
							<view class="desc">
								<template v-if="tabData.KH_customer_attitude == 1">积极主动</template>
								<template v-if="tabData.KH_customer_attitude == 2">沟通顺畅</template>
								<template v-if="tabData.KH_customer_attitude == 3">敷衍了事</template>
								<template v-if="tabData.KH_customer_attitude == 4">拒不配合</template>
								<template v-if="tabData.KH_customer_attitude == 0">--</template>
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('KH_annual_store_opening_plan')">
							<view class="title">年度开店计划</view>
							<view class="desc">
								<template v-if="tabData.KH_annual_store_opening_plan == 1">不连续且少量开店</template>
								<template v-if="tabData.KH_annual_store_opening_plan == 2">不连续且大量开店</template>
								<template v-if="tabData.KH_annual_store_opening_plan == 3">持续且少量开店</template>
								<template v-if="tabData.KH_annual_store_opening_plan == 4">持续且大量开店</template>
								<template v-if="tabData.KH_annual_store_opening_plan == 0">--</template>
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('KH_investment_capability')">
							<view class="title">投资能力</view>
							<view class="desc">
								<template v-if="tabData.KH_investment_capability == 1">100w以下</template>
								<template v-if="tabData.KH_investment_capability == 2">100-500w</template>
								<template v-if="tabData.KH_investment_capability == 3">500-1000w</template>
								<template v-if="tabData.KH_investment_capability == 4">1000w以上</template>
								<template v-if="tabData.KH_investment_capability == 0">--</template>
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('KH_remark')">
							<view class="title">备注</view>
							<view class="desc">
								{{ tabData.KH_remark || '--' }}
							</view>
						</view>
					</view>
					<blcok v-for="(item, index) in tabData.KH_partner_list" :key="index">
						<view class="tips" v-if="khlxrItemShow">
							<view class="icon"></view>
							<view class="title">联系人{{ index + 1 }}</view>
						</view>
						<view class="content-box">
							<view class="content-box-item" v-if="fieldShowFunc('customer_name')">
								<view class="title">联系人名称</view>
								<view class="desc">
									{{ item.customer_name || '--' }}
								</view>
							</view>
							<view class="content-box-item" v-if="fieldShowFunc('customer_phone')">
								<view class="title">联系方式</view>
								<view class="desc">
									{{ item.customer_phone || '--' }}
								</view>
							</view>
							<view class="content-box-item" v-if="fieldShowFunc('customer_identity')">
								<view class="title">客户身份</view>
								<view class="desc">
									<template v-if="item.customer_identity == 1">老板</template>
									<template v-if="item.customer_identity == 2">合伙人</template>
									<template v-if="item.customer_identity == 3">项目负责人</template>
									<template v-if="item.customer_identity == 0">--</template>
								</view>
							</view>
							<view class="content-box-item" v-if="fieldShowFunc('customer_attention')">
								<view class="title">对客关注度</view>
								<view class="desc">
									<template v-if="item.customer_attention == 1">持续重点关注</template>
									<template v-if="item.customer_attention == 2">持续关注</template>
									<template v-if="item.customer_attention == 3">定期关注</template>
									<template v-if="item.customer_attention == 4">不定期关注</template>
									<template v-if="item.customer_attention == 5">一般关注</template>
									<template v-if="item.customer_attention == 0">--</template>
								</view>
							</view>
							<view class="content-box-item" v-if="fieldShowFunc('customer_attitude')">
								<view class="title">客户态度</view>
								<view class="desc">
									<template v-if="item.customer_attitude == 1">积极主动</template>
									<template v-if="item.customer_attitude == 2">沟通顺畅</template>
									<template v-if="item.customer_attitude == 3">敷衍了事</template>
									<template v-if="item.customer_attitude == 4">拒不配合</template>
									<template v-if="item.customer_attitude == 0">--</template>
								</view>
							</view>
							<view class="content-box-item" v-if="fieldShowFunc('annual_store_opening_plan')">
								<view class="title">年度开店计划</view>
								<view class="desc">
									<template v-if="item.annual_store_opening_plan == 1">不连续且少量开店</template>
									<template v-if="item.annual_store_opening_plan == 2">不连续且大量开店</template>
									<template v-if="item.annual_store_opening_plan == 3">持续且少量开店</template>
									<template v-if="item.annual_store_opening_plan == 4">持续且大量开店</template>
									<template v-if="item.annual_store_opening_plan == 0">--</template>
								</view>
							</view>
							<view class="content-box-item" v-if="fieldShowFunc('current_operating_brand')">
								<view class="title">目前经营品牌</view>
								<view class="desc">
									{{ item.current_operating_brand || '--' }}
								</view>
							</view>
							<view class="content-box-item" v-if="fieldShowFunc('secondary_social_relations')">
								<view class="title">次社会关系</view>
								<view class="desc">
									<template v-if="item.secondary_social_relations == 1">品牌方关系户</template>
									<template v-if="item.secondary_social_relations == 2">我司关系户</template>
									<template v-if="item.secondary_social_relations == 3">政府关系户</template>
									<template v-if="item.secondary_social_relations == 4">一般关系</template>
									<template v-if="item.secondary_social_relations == 0">--</template>
								</view>
							</view>
							<view class="content-box-item" v-if="fieldShowFunc('investment_capability')">
								<view class="title">投资能力</view>
								<view class="desc">
									<template v-if="item.investment_capability == 1">100w以下</template>
									<template v-if="item.investment_capability == 2">100-500w</template>
									<template v-if="item.investment_capability == 3">500-1000w</template>
									<template v-if="item.investment_capability == 4">1000w以上</template>
									<template v-if="item.investment_capability == 0">--</template>
								</view>
							</view>
							<view class="content-box-item" v-if="fieldShowFunc('customer_remark')">
								<view class="title">备注</view>
								<view class="desc">{{ item.remark || '--' }}</view>
							</view>
						</view>
					</blcok>
				</uv-transition>
				<uv-transition :show="data.tabActive == 2 && tabData">
					<view class="content-box" v-if="data.tabActive == 2 && !pageLoading && tabData && kcxxItemShow">
						<view class="content-box-item" v-if="fieldShowFunc('designer_name')">
							<view class="title">设计师</view>
							<view class="desc">{{ tabData.designer_name || '--' }}</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('site_surveyors_name')">
							<view class="title">勘场工程经理</view>
							<view class="desc">
								{{ tabData.site_surveyors_name || '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('apply_survey_date')">
							<view class="title">申请勘场日期</view>
							<view class="desc">
								{{ tabData.apply_survey_date || '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('survey_date')">
							<view class="title">约定勘场日期</view>
							<view class="desc">{{ tabData.survey_date || '--' }}</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('actual_survey_date')">
							<view class="title">实际勘场日期</view>
							<view class="desc">
								{{ tabData.actual_survey_date || '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('scene_file')">
							<view class="title">现场图片</view>
							<template v-if="tabData.scene_file.length">
								<view>
									<view v-for="(item, index) in tabData.scene_file" :key="index" @click="preFileFunc(item)" class="desc underline">
										{{ item.file_name }}
									</view>
								</view>
							</template>
							<template v-else>--</template>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('sketch_file')">
							<view class="title">手绘图</view>
							<template v-if="tabData.sketch_file.length">
								<view>
									<view v-for="(item, index) in tabData.sketch_file" :key="index" @click="preFileFunc(item)" class="desc underline">
										{{ item.file_name }}
									</view>
								</view>
							</template>
							<template v-else>--</template>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('video_file')">
							<view class="title">现场视频</view>
							<template v-if="tabData.video_file.length">
								<view>
									<view v-for="(item, index) in tabData.video_file" :key="index" @click="preFileFunc(item)" class="desc underline">
										{{ item.file_name }}
									</view>
								</view>
							</template>
							<template v-else>--</template>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('report_file')">
							<view class="title">勘场报告</view>
							<template v-if="tabData.report_file.length">
								<view>
									<view @click="preFileFunc(item)" class="desc underline" v-for="(item, index) in tabData.report_file" :key="index">
										{{ item.file_name }}
									</view>
								</view>
							</template>
							<template v-else>--</template>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('survey_data')">
							<view class="title">勘场资料</view>
							<template v-if="tabData.survey_data.length">
								<view>
									<view v-for="(item, index) in tabData.survey_data" :key="index" @click="preFileFunc(item)" class="desc underline">
										{{ item.file_name }}
									</view>
								</view>
							</template>
							<template v-else>--</template>
						</view>
					</view>
					<view class="tips" v-if="xmsjtItemShow">
						<view class="icon"></view>
						<view class="title">项目设计图</view>
					</view>
					<view class="content-box" v-if="data.tabActive == 2 && !pageLoading && xmsjtItemShow">
						<view class="content-box-item" v-if="fieldShowFunc('plan_drawing_image')">
							<view class="title">平面图</view>
							<template v-if="tabData.DesignDrawings.plan_drawing_image.length">
								<view>
									<view v-for="(item, index) in tabData.DesignDrawings.plan_drawing_image" :key="index" @click="preFileFunc(item)" class="desc underline">
										{{ item.file_name }}
									</view>
								</view>
							</template>
							<template v-else>--</template>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('plan_drawing')">
							<view class="title">平面图文件</view>
							<template v-if="tabData.DesignDrawings.plan_drawing.length">
								<view>
									<view v-for="(item, index) in tabData.DesignDrawings.plan_drawing" :key="index" @click="preFileFunc(item)" class="desc underline">
										{{ item.file_name }}
									</view>
								</view>
							</template>
							<template v-else>--</template>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('effect_drawing_image')">
							<view class="title">效果图</view>
							<template v-if="tabData.DesignDrawings.effect_drawing_image.length">
								<view>
									<view v-for="(item, index) in tabData.DesignDrawings.effect_drawing_image" :key="index" @click="preFileFunc(item)" class="desc underline">
										{{ item.file_name }}
									</view>
								</view>
							</template>
							<template v-else>--</template>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('effect_drawing')">
							<view class="title">效果图文件</view>
							<template v-if="tabData.DesignDrawings.effect_drawing.length">
								<view>
									<view v-for="(item, index) in tabData.DesignDrawings.effect_drawing" :key="index" @click="preFileFunc(item)" class="desc underline">
										{{ item.file_name }}
									</view>
								</view>
							</template>
							<template v-else>--</template>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('construction_drawing_image')">
							<view class="title">施工图</view>
							<template v-if="tabData.DesignDrawings.construction_drawing_image.length">
								<view>
									<view v-for="(item, index) in tabData.DesignDrawings.construction_drawing_image" :key="index" @click="preFileFunc(item)" class="desc underline">
										{{ item.file_name }}
									</view>
								</view>
							</template>
							<template v-else>--</template>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('construction_drawing')">
							<view class="title">施工图文件</view>
							<template v-if="tabData.DesignDrawings.construction_drawing.length">
								<view>
									<view v-for="(item, index) in tabData.DesignDrawings.construction_drawing" :key="index" @click="preFileFunc(item)" class="desc underline">
										{{ item.file_name }}
									</view>
								</view>
							</template>
							<template v-else>--</template>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('other_file')">
							<view class="title">其他文件</view>
							<template v-if="tabData.DesignDrawings.other_file.length">
								<view>
									<view v-for="(item, index) in tabData.DesignDrawings.other_file" :key="index" @click="preFileFunc(item)" class="desc underline">
										{{ item.file_name }}
									</view>
								</view>
							</template>
							<template v-else>--</template>
						</view>
					</view>
				</uv-transition>
				<uv-transition :show="data.tabActive == 3 && tabData">
					<view class="content-box" v-if="data.tabActive == 3 && !pageLoading && tabData && bjxxItemShow">
						<view class="content-box-item" v-if="fieldShowFunc('cost_estimator_name')">
							<view class="title">造价员</view>
							<view class="desc">
								{{ tabData.cost_estimator_name || '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('bj_created_at')">
							<view class="title">申请报价日期</view>
							<view class="desc">
								{{ tabData.created_at || '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('completion_at')">
							<view class="title">最终报价日期</view>
							<view class="desc">
								{{ tabData.completion_at || '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('start_date')">
							<view class="title">开工日期</view>
							<view class="desc">
								{{ tabData.start_date || '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('end_date')">
							<view class="title">完工日期</view>
							<view class="desc">
								{{ tabData.end_date || '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('duration_days')">
							<view class="title">工期</view>
							<view class="desc">
								{{ tabData.duration_days ? tabData.duration_days + '天' : '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('building_area')">
							<view class="title">项目面积</view>
							<view class="desc">
								{{ tabData.building_area ? tabData.building_area + 'm²' : '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('quotation_amount')">
							<view class="title">报价金额</view>
							<view class="desc">
								{{ tabData.quotation_amount ? tabData.quotation_amount + '元' : '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('basic_decoration_fee')">
							<view class="title">基础装修费</view>
							<view class="desc">
								{{ tabData.basic_decoration_fee ? tabData.basic_decoration_fee + '元' : '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('material_costs')">
							<view class="title">主材采购费</view>
							<view class="desc">
								{{ tabData.material_costs ? tabData.material_costs + '元' : '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('quotation_taxes')">
							<view class="title">税金</view>
							<view class="desc">
								{{ tabData.quotation_taxes ? tabData.quotation_taxes + '元' : '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('cost_amount')">
							<view class="title">成本金额</view>
							<view class="desc">{{ tabData.cost_amount ? tabData.cost_amount + '元' : '--' }}</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('procurement_cost')">
							<view class="title">现场采购成本</view>
							<view class="desc">
								{{ tabData.procurement_cost ? tabData.procurement_cost + '元' : '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('centralized_procurement_cost')">
							<view class="title">公司集采成本</view>
							<view class="desc">
								{{ tabData.centralized_procurement_cost ? tabData.centralized_procurement_cost + '元' : '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('management_costs')">
							<view class="title">管理成本</view>
							<view class="desc">
								{{ tabData.management_costs ? tabData.management_costs + '元' : '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('profit_amount')">
							<view class="title">利润金额</view>
							<view class="desc">{{ tabData.profit_amount ? tabData.profit_amount + '元' : '--' }}</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('quotation_file')">
							<view class="title">报价附件</view>
							<template v-if="tabData.quotation_file.length">
								<view>
									<view v-for="(item, index) in tabData.quotation_file" :key="index" @click="preFileFunc(item)" class="desc underline">
										{{ item.file_name }}
									</view>
								</view>
							</template>
							<template v-else>--</template>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('cost_list_file')">
							<view class="title">成本附件</view>
							<template v-if="tabData.cost_list_file.length">
								<view>
									<view v-for="(item, index) in tabData.cost_list_file" :key="index" @click="preFileFunc(item)" class="desc underline">
										{{ item.file_name }}
									</view>
								</view>
							</template>
							<template v-else>--</template>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('profit_statement_file')">
							<view class="title">利润附件</view>
							<template v-if="tabData.profit_statement_file.length">
								<view>
									<view v-for="(item, index) in tabData.profit_statement_file" :key="index" @click="preFileFunc(item)" class="desc underline">
										{{ item.file_name }}
									</view>
								</view>
							</template>
							<template v-else>--</template>
						</view>
					</view>
					<!-- 增减项列表 -->
					<template v-if="data.tabActive == 3 && !pageLoading">
						<view class="tips" v-if="zjTableData.length && zjxxxItemShow">
							<view class="icon"></view>
							<view class="title">增减项列表</view>
						</view>
						<block v-for="(item, index) in zjTableData" :key="index">
							<view class="zjx-item" v-if="zjxxxItemShow">
								<view class="zjx-2">
									<view class="zjx-2-1" v-if="fieldShowFunc('zj_created_at')">
										<view class="label">申请报价日期</view>
										<view class="desc">{{ item.created_at }}</view>
									</view>
									<view class="zjx-2-1" v-if="fieldShowFunc('final_quotation_time')">
										<view class="label">最终报价日期</view>
										<view class="desc">
											{{ item.final_quotation_time || '--' }}
										</view>
									</view>
								</view>
								<view class="zjx-2">
									<view class="zjx-2-1" v-if="fieldShowFunc('expect_duration_days')">
										<view class="label">工期</view>
										<view class="desc">
											{{ item.expect_duration_days ? item.expect_duration_days + '天' : '--' }}
										</view>
									</view>
									<view class="zjx-2-1" v-if="fieldShowFunc('increase_or_decrease')">
										<view class="label">增减类型</view>
										<view class="desc">
											{{ item.increase_or_decrease == 1 ? '增项' : '减项' }}
										</view>
									</view>
								</view>
								<view class="zjx-1" v-if="fieldShowFunc('change_content')">
									<view class="label">增减内容</view>
									<view class="desc">
										<template v-if="item.change_content == 1">顶面工程</template>
										<template v-if="item.change_content == 2">地面工程</template>
										<template v-if="item.change_content == 3">墙面工程</template>
										<template v-if="item.change_content == 4">水电工程</template>
										<template v-if="item.change_content == 5">楼梯工程</template>
										<template v-if="item.change_content == 6">广告工程</template>
										<template v-if="item.change_content == 7">外立面工程</template>
										<template v-if="item.change_content == 8">其他工程</template>
									</view>
								</view>
								<view class="line"></view>
								<view class="zjx-2">
									<view class="zjx-2-1" v-if="fieldShowFunc('zj_quotation_amount')">
										<view class="label">报价金额</view>
										<view class="desc">
											{{ item.quotation.quotation_amount ? item.quotation.quotation_amount + '元' : '--' }}
										</view>
									</view>
									<view class="zjx-2-1" v-if="fieldShowFunc('zj_profit_amount')">
										<view class="label">利润金额</view>
										<view class="desc">
											{{ item.quotation.profit_amount ? item.quotation.profit_amount + '元' : '--' }}
										</view>
									</view>
								</view>
								<view class="zjx-2">
									<view class="zjx-2-1" v-if="fieldShowFunc('zj_material_costs')">
										<view class="label">主材采购费</view>
										<view class="desc">{{ item.material_costs ? item.material_costs + '元' : '--' }}</view>
									</view>
									<view class="zjx-2-1" v-if="fieldShowFunc('zj_quotation_taxes')">
										<view class="label">税金</view>
										<view class="desc">
											{{ item.quotation.quotation_taxes ? item.quotation.quotation_taxes + '元' : '--' }}
										</view>
									</view>
								</view>
								<view class="zjx-2">
									<view class="zjx-2-1" v-if="fieldShowFunc('zj_cost_amount')">
										<view class="label">成本金额</view>
										<view class="desc">
											{{ item.quotation.cost_amount ? item.quotation.cost_amount + '元' : '--' }}
										</view>
									</view>
									<view class="zjx-2-1" v-if="fieldShowFunc('zj_management_costs')">
										<view class="label">管理成本</view>
										<view class="desc">
											{{ item.quotation.management_costs ? item.quotation.management_costs + '元' : '--' }}
										</view>
									</view>
								</view>
								<view class="zjx-2">
									<view class="zjx-2-1" v-if="fieldShowFunc('zj_procurement_cost')">
										<view class="label">现场采购成本</view>
										<view class="desc">
											{{ item.quotation.procurement_cost ? item.quotation.procurement_cost + '元' : '--' }}
										</view>
									</view>
									<view class="zjx-2-1" v-if="fieldShowFunc('zj_centralized_procurement_cost')">
										<view class="label">公司采集成本</view>
										<view class="desc">
											{{ item.quotation.centralized_procurement_cost ? item.quotation.centralized_procurement_cost + '元' : '--' }}
										</view>
									</view>
								</view>
								<view class="zjx-2" v-if="fieldShowFunc('zj_basic_decoration_fee')">
									<view class="zjx-2-1">
										<view class="label">基础装修费</view>
										<view class="desc">
											{{ item.basic_decoration_fee ? item.basic_decoration_fee + '元' : '--' }}
										</view>
									</view>
								</view>
								<view class="zjx-2" v-if="fieldShowFunc('zj_desc')">
									<view class="zjx-2-1">
										<view class="label">备注</view>
										<view class="desc">{{ item.remark || '--' }}</view>
									</view>
								</view>
								<view class="zjx-1" v-if="fieldShowFunc('zj_change_file')">
									<view class="label">增减项附件</view>
									<template v-if="item.change_file.length">
										<view>
											<view v-for="(file, fileIndex) in item.profit_statement_file" :key="fileIndex" @click="preFileFunc(file)" class="desc underline">
												{{ file.file_name }}
											</view>
										</view>
									</template>
									<template v-else>--</template>
								</view>
								<!-- <view class="zjx-1" v-if="fieldShowFunc('profit_statement_file')">
									<view class="label">报价附件</view>
									<template v-if="item.quotation.profit_statement_file.length">
										<view>
											<view v-for="(item, index) in item.quotation.profit_statement_file" :key="index" @click="preFileFunc(item)" class="desc underline">
												{{ item.file_name }}
											</view>
										</view>
									</template>
									<template v-else>--</template>
								</view>
								<view class="zjx-1" v-if="fieldShowFunc('cost_list_file')">
									<view class="label">成本附件</view>
									<template v-if="item.quotation.cost_list_file.length">
										<view>
											<view v-for="(item, index) in item.quotation.cost_list_file" :key="index" @click="preFileFunc(item)" class="desc underline">
												{{ item.file_name }}
											</view>
										</view>
									</template>
									<template v-else>--</template>
								</view>
								<view class="zjx-1" v-if="fieldShowFunc('profit_statement_file')">
									<view class="label">利润附件</view>
									<template v-if="item.quotation.profit_statement_file.length">
										<view>
											<view v-for="(item, index) in item.quotation.profit_statement_file" :key="index" @click="preFileFunc(item)" class="desc underline">
												{{ item.file_name }}
											</view>
										</view>
									</template>
									<template v-else>--</template>
								</view> -->
								<view class="zjx-1" @click="goToZjDetailFunc(item.id, 'zj')">
									<view class="label" style="color: #3d7fff">详情</view>
								</view>
							</view>
						</block>
					</template>
				</uv-transition>
				<uv-transition :show="data.tabActive == 4 && tabData">
					<view class="content-box" v-if="data.tabActive == 4 && !pageLoading && tabData">
						<view class="content-box-item" v-if="fieldShowFunc('signing_date')">
							<view class="title">合同签约日期</view>
							<view class="desc">{{ tabData.signing_date || '--' }}</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('account_name')">
							<view class="title">签约主体</view>
							<view class="desc">{{ tabData.account_name || '--' }}</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('system_quotation')">
							<view class="title">最终报价金额</view>
							<view class="desc">{{ tabData.system_quotation ? tabData.system_quotation + '元' : '--' }}</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('contract_price')">
							<view class="title">合同签约金额</view>
							<view class="desc">{{ tabData.contract_price ? tabData.contract_price + '元' : '--' }}</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('contract_quotation_ratio')">
							<view class="title">合同报价比</view>
							<view class="desc">
								{{ tabData.contract_quotation_ratio ? tabData.contract_quotation_ratio + '%' : '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('contract_profit_margin')">
							<view class="title">合同利润率</view>
							<view class="desc">
								{{ tabData.contract_profit_margin ? tabData.contract_profit_margin + '%' : '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('contract_commencement_date')">
							<view class="title">合同开工日期</view>
							<view class="desc">
								{{ tabData.contract_commencement_date || '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('contract_completion_date')">
							<view class="title">合同完工日期</view>
							<view class="desc">
								{{ tabData.contract_completion_date || '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('contract_duration_days')">
							<view class="title">合同工期</view>
							<view class="desc">
								{{ tabData.contract_duration_days ? tabData.contract_duration_days + '天' : '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('settlement_completion_date')">
							<view class="title">结算完成日期</view>
							<view class="desc">{{ tabData.settlement_completion_date || '--' }}</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('contract_files')">
							<view class="title">合同附件</view>
							<template v-if="tabData.contract_files.length">
								<view>
									<view v-for="(item, index) in tabData.contract_files" :key="index" @click="preFileFunc(item)" class="desc underline">
										{{ item.file_name }}
									</view>
								</view>
							</template>
							<template v-else>--</template>
						</view>
					</view>
				</uv-transition>
				<uv-transition :show="data.tabActive == 5 && tabData">
					<view class="content-box" v-if="data.tabActive == 5 && !pageLoading && tabData && sgxxItemShow">
						<view class="content-box-item" v-if="fieldShowFunc('engineering_manager_name')">
							<view class="title">施工工程经理</view>
							<view class="desc">
								{{ detailData.engineering_manager_name || '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('engineering_supervision_name')">
							<view class="title">工程监理</view>
							<view class="desc">
								{{ detailData.engineering_supervision_name || '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('construction_progress')">
							<view class="title">施工进度</view>
							<view class="desc">
								<template>
									<text v-if="tabData.construction_status == 42">待进场</text>
									<text v-if="tabData.construction_status == 45">施工中</text>
									<text v-if="tabData.construction_status == 50">已完工</text>
									<text v-if="tabData.construction_status != 42 && tabData.construction_status != 45 && tabData.construction_status != 50">--</text>
								</template>
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('on_site_start_date')">
							<view class="title">实际开工日期</view>
							<view class="desc">
								{{ tabData.on_site_start_date || '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('actual_completion_date')">
							<view class="title">实际完工日期</view>
							<view class="desc">
								{{ tabData.actual_completion_date || '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('current_duration')">
							<view class="title">当前工期</view>
							<view class="desc">{{ tabData.current_duration ? tabData.current_duration + '天' : '--' }}</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('actual_duration')">
							<view class="title">实际工期</view>
							<view class="desc">{{ tabData.actual_duration ? tabData.actual_duration + '天' : '--' }}</view>
						</view>
					</view>
					<!-- 施工日志 -->
					<view class="tips" v-if="constructionLogs.length && sgrzImteShow">
						<view class="icon"></view>
						<view class="title">施工日志</view>
					</view>
					<block v-for="(item, index) in constructionLogs" :key="index">
						<view class="content-box" style="margin-bottom: 20rpx" v-if="sgrzImteShow">
							<view class="content-box-item" v-if="fieldShowFunc('sg_construction_progress')">
								<view class="title">施工进度</view>
								<view class="desc">
									<template v-if="item.construction_progress == 10">待进场</template>
									<template v-if="item.construction_progress == 20">施工中</template>
									<template v-if="item.construction_progress == 30">一次预警</template>
									<template v-if="item.construction_progress == 40">二次预警</template>
									<template v-if="item.construction_progress == 50">已超期</template>
									<template v-if="item.construction_progress == 60">停工中</template>
									<template v-if="item.construction_progress == 70">已完工</template>
								</view>
							</view>
							<view class="content-box-item" v-if="fieldShowFunc('is_overdue')">
								<view class="title">是否超期</view>
								<view class="desc">
									{{ item.is_overdue == 1 ? '是' : '否' }}
								</view>
							</view>
							<view class="content-box-item" v-if="item.is_overdue == 1 && fieldShowFunc('sg_overdue_type')">
								<view class="title">超期类型</view>
								<view class="desc">
									<template v-if="item.overdue_type == 1">客户原因</template>
									<template v-if="item.overdue_type == 2">供应商原因</template>
									<template v-if="item.overdue_type == 3">物业原因</template>
									<template v-if="item.overdue_type == 4">城管审批</template>
									<template v-if="item.overdue_type == 5">不可抗力</template>
									<template v-if="item.overdue_type == 6">现场管理</template>
									<template v-if="item.overdue_type == 7">图纸变更</template>
									<template v-if="item.overdue_type == 8">其他原因</template>
								</view>
							</view>
							<view class="content-box-item" v-if="item.is_overdue == 1 && fieldShowFunc('sg_reason_overdue')">
								<view class="title">超期原因</view>
								<view class="desc">
									{{ item.reason_overdue || '--' }}
								</view>
							</view>
							<view class="content-box-item" v-if="fieldShowFunc('construction_stage')">
								<view class="title">施工阶段</view>
								<view class="desc">
									{{ item.construction_stage || '--' }}
								</view>
							</view>
							<view class="content-box-item" v-if="fieldShowFunc('sg_content')">
								<view class="title">施工内容</view>
								<view class="desc">
									{{ item.content || '--' }}
								</view>
							</view>
							<view class="content-box-item" v-if="item.construction_files.length && fieldShowFunc('sg_log_file')">
								<view class="title">日志文件</view>
								<view>
									<view v-for="(file, fileIndex) in item.construction_files" :key="fileIndex" @click="preFileFunc(file)" class="desc underline">
										{{ file.file_name }}
									</view>
								</view>
							</view>
						</view>
					</block>
					<!-- 验收节点 -->
					<block v-for="(item, index) in detailData.project_nodes" :key="index">
						<template v-if="fieldShowFunc('project_nodes')">
							<view class="tips">
								<view class="icon"></view>
								<view class="title">{{ item.node_name }}</view>
								<uni-tooltip placement="top" v-if="item.remark">
									<template v-slot:content>
										<view style="width: 200rpx">
											{{ item.remark }}
										</view>
									</template>
									<uni-icons type="help" color="#828A9D"></uni-icons>
								</uni-tooltip>
								<uv-tags text="待提交" v-if="item.node_status == 1" size="mini" borderColor="#E9E9EB" color="#909399" bgColor="#F4F4F5" plain plainFill></uv-tags>
								<uv-tags
									v-if="item.node_status == 2 || item.node_status == 3"
									text="待验收"
									size="mini"
									borderColor="#E9E9EB"
									color="#909399"
									bgColor="#F4F4F5"
									plain
									plainFill
								></uv-tags>
								<uv-tags v-if="item.node_status > 4 || item.node_status == 4" text="已验收" size="mini" plain plainFill></uv-tags>
							</view>
							<view class="content-box">
								<block v-for="(child, childIndex) in item.children" :key="childIndex">
									<view class="content-box-item" v-if="child.content_type == 1">
										<view class="title">{{ child.node_name }}</view>
										<view class="desc">{{ child.content || '--' }}</view>
									</view>
									<view class="content-box-item" v-else>
										<view class="title">{{ child.node_name }}</view>
										<template v-if="child.node_files.length">
											<!-- <view @click="fileMoreFunc(child.node_files)" class="desc underline" v-if="child.node_files.length > 1">点击查看</view>
											<view @click="preFileFunc(child.node_files[0])" class="desc underline" v-else>
												{{ child.node_files[0].file_name }}
											</view> -->
											<view>
												<view @click="preFileFunc(file)" v-for="(file, fileIndex) in child.node_files" :key="fileIndex" class="desc underline">
													{{ file.file_name }}
												</view>
											</view>
										</template>
										<template v-else>--</template>
									</view>
								</block>
							</view>
						</template>
					</block>
				</uv-transition>
				<uv-transition :show="data.tabActive == 6 && tabData">
					<view class="payment-box" v-if="data.tabActive == 6 && !pageLoading && tabData">
						<view class="payment-item" v-for="(item, index) in tabData" :key="index">
							<view class="image-box" v-if="fieldShowFunc('voucher_file')">
								<image :src="item.voucher_file[0].file_url" mode="aspectFill" @click="preFileFunc(item.voucher_file[0])"></image>
							</view>
							<view class="payment-content-box">
								<view class="content-item" v-if="fieldShowFunc('payment_type')">
									<view class="label">收款类型：</view>
									<view class="desc">
										<template v-if="item.payment_type == 1">勘场费用</template>
										<template v-if="item.payment_type == 2">预付款</template>
										<template v-if="item.payment_type == 3">进度款</template>
										<template v-if="item.payment_type == 4">尾款</template>
										<template v-if="item.payment_type == 5">增项款</template>
									</view>
								</view>
								<view class="content-item" v-if="fieldShowFunc('account_number')">
									<view class="label">收款账户：</view>
									<view class="desc">{{ item.account_number }}</view>
								</view>
								<view class="content-item" v-if="fieldShowFunc('receiving_account')">
									<view class="label">账户名称：</view>
									<view class="desc">
										{{ item.receiving_account }}
									</view>
								</view>
								<view class="content-item" v-if="fieldShowFunc('amount_collected')">
									<view class="label">收款金额：</view>
									<view class="desc">
										{{ item.amount_collected ? item.amount_collected + '元' : '--' }}
									</view>
								</view>
								<view class="content-item" v-if="fieldShowFunc('sk_created_at')">
									<view class="label">收款时间：</view>
									<view class="desc">
										{{ item.created_at }}
									</view>
								</view>
							</view>
							<view class="payment-state" v-if="fieldShowFunc('review_status')">
								<uv-tags v-if="item.review_status == 2" text="已收款" size="mini" borderColor="#E6EDFF" bgColor="#E6EDFF" color="#3B75FF" plain plainFill></uv-tags>
								<uv-tags v-if="item.review_status == 1" text="待审核" size="mini" borderColor="#FFF3E9" bgColor="#FFF3E9" color="#FF9558" plain plainFill></uv-tags>
							</view>
						</view>
					</view>
				</uv-transition>
				<uv-transition :show="data.tabActive == 7 && tabData">
					<view class="content-box" v-if="wbxxImteShow">
						<view class="content-box-item" v-if="fieldShowFunc('warranty_deadline_date')">
							<view class="title">质保截止日期</view>
							<view class="desc">
								{{ tabData.warranty_deadline_date || '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('is_sell_by')">
							<view class="title">是否质保期</view>
							<view class="desc">
								<template v-if="tabData.is_sell_by == 0">--</template>
								<template v-if="tabData.is_sell_by == 1">是</template>
								<template v-if="tabData.is_sell_by == 2">否</template>
							</view>
						</view>
					</view>

					<template v-if="data.tabActive == 7 && !pageLoading">
						<view class="tips" v-if="tabData.list.length && wbjlImteShow">
							<view class="icon"></view>
							<view class="title">维保记录</view>
						</view>
						<block v-for="(item, index) in tabData.list" :key="index">
							<view class="zjx-item" v-if="wbjlImteShow">
								<view class="zjx-2">
									<view class="zjx-2-1" v-if="fieldShowFunc('problem_content')">
										<view class="label">内容描述</view>
										<view class="desc">
											{{ item.problem_content }}
										</view>
									</view>
									<view class="zjx-2-1" v-if="fieldShowFunc('user_name')">
										<view class="label">发起人</view>
										<view class="desc">{{ item.user_name }}</view>
									</view>
								</view>
								<view class="zjx-2">
									<view class="zjx-2-1" v-if="fieldShowFunc('after_sales_status')">
										<view class="label">售后状态</view>
										<view class="desc">
											<template v-if="item.after_sales_status == 10">待分配工程监理</template>
											<template v-if="item.after_sales_status == 20">待分配工程经理</template>
											<template v-if="item.after_sales_status == 30">待工程经理反馈现场情况</template>
											<template v-if="item.after_sales_status == 40">待责任判定</template>
											<template v-if="item.after_sales_status == 50">待整改</template>
											<template v-if="item.after_sales_status == 60">工程经理提交完成情况</template>
										</view>
									</view>
									<view class="zjx-2-1" v-if="fieldShowFunc('after_sales_timeliness')">
										<view class="label">销售时效</view>
										<view class="desc">
											{{ item.after_sales_timeliness }}
										</view>
									</view>
								</view>
								<view class="zjx-2">
									<view class="zjx-2-1" v-if="fieldShowFunc('wb_created_at')">
										<view class="label">创建时间</view>
										<view class="desc">{{ item.created_at }}</view>
									</view>
									<view class="zjx-2-1" v-if="fieldShowFunc('wb_completion_date')">
										<view class="label">完成时间</view>
										<view class="desc">
											{{ item.completion_date }}
										</view>
									</view>
								</view>
								<view class="zjx-1" @click="goToZjDetailFunc(item.id, 'sh')">
									<view class="label" style="color: #3d7fff">详情</view>
								</view>
							</view>
						</block>
					</template>
				</uv-transition>
				<uv-transition :show="data.tabActive == 9 && tabData">
					<view class="content-box" v-if="data.tabActive == 9 && !pageLoading && tabData">
						<view class="content-box-item" v-if="fieldShowFunc('settlement_completion_start_date')">
							<view class="title">出具结算单日期</view>
							<view class="desc">
								{{ tabData.settlement_completion_start_date || '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('js_settlement_completion_date')">
							<view class="title">结算完成日期</view>
							<view class="desc">
								{{ tabData.settlement_completion_date || '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('js_contract_price')">
							<view class="title">合同签约金额</view>
							<view class="desc">
								{{ tabData.contract_price ? tabData.contract_price + '元' : '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('changes_amount')">
							<view class="title">增减项总金额</view>
							<view class="desc">
								{{ tabData.changes_amount ? tabData.changes_amount + '元' : '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('settlement_amount')">
							<view class="title">应结算金额</view>
							<view class="desc">
								{{ tabData.settlement_amount ? tabData.settlement_amount + '元' : '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('js_procurement_cost')">
							<view class="title">现场采购成本</view>
							<view class="desc">
								{{ tabData.procurement_cost ? tabData.procurement_cost + '元' : '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('js_centralized_procurement_cost')">
							<view class="title">公司采集成本</view>
							<view class="desc">
								{{ tabData.centralized_procurement_cost ? tabData.centralized_procurement_cost + '元' : '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('js_management_costs')">
							<view class="title">管理成本</view>
							<view class="desc">
								{{ tabData.management_costs ? tabData.management_costs + '元' : '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('js_profit_amount')">
							<view class="title">利润金额</view>
							<view class="desc">
								{{ tabData.profit_amount ? tabData.profit_amount + '元' : '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('js_paid_amount')">
							<view class="title">已付款金额</view>
							<view class="desc">
								{{ tabData.paid_amount ? tabData.paid_amount + '元' : '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('js_unpaid_amount')">
							<view class="title">待付款金额</view>
							<view class="desc">
								{{ tabData.unpaid_amount ? tabData.unpaid_amount + '元' : '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('js_settlement_taxes')">
							<view class="title">结算税金</view>
							<view class="desc">
								{{ tabData.settlement_taxes ? tabData.settlement_taxes + '元' : '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('js_settlement_cost_amount')">
							<view class="title">成本金额</view>
							<view class="desc">
								{{ tabData.settlement_cost_amount ? tabData.settlement_cost_amount + '元' : '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('js_settlement_profit_margin')">
							<view class="title">利润率</view>
							<view class="desc">
								{{ tabData.settlement_profit_margin ? tabData.settlement_profit_margin + '%' : '--' }}
							</view>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('js_settlement_file')">
							<view class="title">项目结算单</view>
							<template v-if="tabData.settlement_file.length">
								<view>
									<view v-for="(item, index) in tabData.settlement_file" :key="index" @click="preFileFunc(item)" class="desc underline">
										{{ item.file_name }}
									</view>
								</view>
							</template>
							<template v-else>--</template>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('js_inventory_file')">
							<view class="title">工程量清单</view>
							<template v-if="tabData.inventory_file.length">
								<view>
									<view v-for="(item, index) in tabData.inventory_file" :key="index" @click="preFileFunc(item)" class="desc underline">
										{{ item.file_name }}
									</view>
								</view>
							</template>
							<template v-else>--</template>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('js_profit_statement_file')">
							<view class="title">利润单</view>
							<template v-if="tabData.profit_statement_file.length">
								<view>
									<view v-for="(item, index) in tabData.profit_statement_file" :key="index" @click="preFileFunc(item)" class="desc underline">
										{{ item.file_name }}
									</view>
								</view>
							</template>
							<template v-else>--</template>
						</view>
						<view class="content-box-item" v-if="fieldShowFunc('js_desc')">
							<view class="title">备注</view>
							<view class="desc">
								{{ tabData.remark || '--' }}
							</view>
						</view>
					</view>
				</uv-transition>
			</view>
		</z-paging>
	</view>
	<!-- 多文件展示 -->
	<uv-modal ref="fileModal" title="文件列表" @confirm="" confirmText="关闭">
		<scroll-view scroll-y style="width: 100%; max-height: 500rpx">
			<view @click="preFileFunc(item)" class="desc underline marign" v-for="(item, index) in fileList" :key="index">
				{{ item.file_name }}
			</view>
		</scroll-view>
	</uv-modal>
	<!-- 文件预览 -->
	<preFileCom :fileObj="fileObj" @onFileSuccess="onFileSuccess"></preFileCom>
</template>

<script setup>
import { reactive, getCurrentInstance, toRefs, ref, nextTick } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
const { proxy: that } = getCurrentInstance();

const data = reactive({
	dataList: [],
	tabActive: 0,
	tabListShow: false,
	tabList: [
		{
			name: '基础信息',
			id: 0
		},
		{
			name: '客户信息',
			id: 1
		},
		{
			name: '勘场信息',
			id: 2
		},
		{
			name: '报价信息',
			id: 3
		},
		{
			name: '合同信息',
			id: 4
		},
		{
			name: '施工信息',
			id: 5
		},
		{
			name: '收款信息',
			id: 6
		},
		{
			name: '结算信息',
			id: 9
		},
		{
			name: '维保信息',
			id: 7
		}
	],
	detailData: {},
	tabData: [],
	pageLoading: true,
	fileList: [],
	zjTableData: [],
	field_permissions: '',
	preVideoShow: false,
	currVideo: '',
	constructionLogs: [],
	jcxxImteShow: true,
	khxxItemShow: true,
	khlxrItemShow: true,
	kcxxItemShow: true,
	xmsjtItemShow: true,
	bjxxItemShow: true,
	zjxxxItemShow: true,
	htxxItemShow: true,
	sgxxItemShow: true,
	sgrzImteShow: true,
	skxxImteShow: true,
	jsxxImteShow: true,
	wbxxImteShow: true,
	wbjlImteShow: true,
	detailId: ''
});
let {
	dataList,
	tabActive,
	tabList,
	detailData,
	tabData,
	pageLoading,
	fileList,
	zjTableData,
	field_permissions,
	preVideoShow,
	currVideo,
	constructionLogs,
	jcxxImteShow,
	khxxItemShow,
	khlxrItemShow,
	kcxxItemShow,
	xmsjtItemShow,
	bjxxItemShow,
	zjxxxItemShow,
	htxxItemShow,
	sgxxItemShow,
	sgrzImteShow,
	skxxImteShow,
	jsxxImteShow,
	wbxxImteShow,
	wbjlImteShow,
	tabListShow,
	detailId
} = toRefs(data);
onLoad((e) => {
	console.log(e);
	setTimeout(() => {
		data.pageLoading = false;
	}, 500);
	data.detailId = e.data;
	getOrganizationDetails();
});
const getConstructionLogs = () => {
	that.$Api
		.getConstructionLogs({
			project_id: data.detailId,
			page: 1,
			num: 99999
		})
		.then((res) => {
			console.log(res, '施工记录列表');
			if (res.code == 200) {
				data.constructionLogs = res.data.list;
			}
		});
};
// 项目详情
const getProjectDetails = (project_id) => {
	let adminHtListVal = [];
	that.$Api
		.getProjectObj({
			project_id
		})
		.then((res) => {
			console.log(res.data, '项目详情', res.data.status);
			if (res.code == 200) {
				data.detailData = res.data;
				// 判断是否只为勘场工程经理（只能看勘场信息）
				let userInfo = uni.getStorageSync('userInfo');
				let isSiteSurveyors = false;
				if (userInfo.userid == res.data.site_surveyors_id && userInfo.userid != res.data.engineering_manager_id) {
					isSiteSurveyors = true;
				}
				// 根据项目状态判断tab当前可点击
				data.tabList.forEach((item) => {
					if (item.name == '勘场信息' && (res.data.status == 1015 || res.data.status < 1015)) {
						item.disabled = true;
					}
					if (item.name == '报价信息' && (res.data.status < 1090 || isSiteSurveyors)) {
						item.disabled = true;
					}
					if (item.name == '合同信息' && (res.data.status < 1105 || isSiteSurveyors)) {
						item.disabled = true;
					}
					if (item.name == '施工信息' && (res.data.status < 1118 || isSiteSurveyors)) {
						item.disabled = true;
					}
					// 不勘场（客户经理提交预付款信息）
					if (item.name == '收款信息' && res.data.survey_site == 1 && (res.data.status < 1110 || isSiteSurveyors)) {
						item.disabled = true;
					}
					// 勘场（客户经理提交勘察费用信息）
					if (item.name == '收款信息' && res.data.survey_site == 2 && (res.data.status < 1025 || isSiteSurveyors)) {
						item.disabled = true;
					}
					// 未选择勘场
					if (item.name == '收款信息' && res.data.survey_site == 0) {
						item.disabled = true;
					}
					if (item.name == '结算信息' && (res.data.status < 1140 || isSiteSurveyors)) {
						item.disabled = true;
					}
					if (item.name == '维保信息' && (res.data.status < 1150 || isSiteSurveyors)) {
						item.disabled = true;
					}
				});
				data.tabList.splice(0, 0);
				data.tabList = data.tabList;
			}
		});
};
// 增减项详情
const goToZjDetailFunc = (id, type) => {
	uni.navigateTo({
		url: type == 'zj' ? '/pages/increase_decrease_items/idi_info/idi_info?id=' + id : '/pages/after_sales_list/as_info/as_info?id=' + id
	});
};
// 多图文件展示
const fileMoreFunc = (fileList) => {
	data.fileList = fileList;
	that.$refs.fileModal.open();
};
const getProjectTabData = (tab_type) => {
	uni.showLoading({
		mask: true
	});
	data.pageLoading = true;
	that.$Api
		.getProjectTabData({
			project_id: data.detailId,
			tab_type
		})
		.then((res) => {
			console.log(res, '项目tab数据');
			if (res.code == 200) {
				if (tab_type == 8) {
					data.zjTableData = res.data;
					return;
				}
				data.tabData = res.data;
				if (tab_type == 3) {
					// 增减项
					getProjectTabData(8);
				}
				if (tab_type == 5) {
					// 施工日志
					getConstructionLogs();
				}
			} else {
				if (tab_type == 8) {
					data.zjTableData = [];
					return;
				}
				data.tabData = '';
			}
			setTimeout(() => {
				data.pageLoading = false;
				data.tabActive = tab_type;
				uni.hideLoading();
			}, 300);
		})
		.catch((err) => {
			setTimeout(() => {
				data.pageLoading = false;
				data.tabActive = tab_type;
				uni.hideLoading();
			}, 300);
		});
};

function queryList(page, num) {
	setTimeout(() => {
		that.$refs.paging.complete([]);
	}, 3000);
}

function onRefresh() {
	setTimeout(() => {
		that.$refs.paging.complete([]);
	}, 1000);
	if (data.tabActive == 0) {
		getProjectDetails(data.detailId);
		return;
	}
	getProjectTabData(data.tabActive);
}

function tabActiveFunc(e) {
	console.log(e, data.tabActive);
	let type = data.tabList[e.index].id;
	if (type == 0) {
		data.tabActive = 0;
		getProjectDetails(data.detailId);
		return;
	}
	data.tabData = '';
	getProjectTabData(type);
	data.tabActive = -1;
	that.$refs.paging.scrollToTop();
}

// 字段权限列表
const getOrganizationDetails = () => {
	uni.showLoading({
		mask: true
	});
	data.field_permissions = {};
	that.$Api
		.getOrganizationDetails({
			id: uni.getStorageSync('userInfo').position_id
		})
		.then((res) => {
			console.log(res, '字段权限列表');
			uni.hideLoading();
			if (res.code == 200) {
				let field_permissionsVal = res.data[0].field_permissions ? JSON.parse(res.data[0].field_permissions) : '';
				nextTick(() => {
					tabIsShowFunc({
						field_permissionsVal
					});
				});
				if (!field_permissionsVal) return;
				field_permissionsVal.forEach((item) => {
					for (let i in item.field_list) {
						data.field_permissions[i] = item.field_list[i];
					}
				});
				console.log(data.field_permissions, '所有权限列表');
			}
		})
		.catch((err) => {
			uni.hideLoading();
		});
};

// 判断tab是否显示
const tabIsShowFunc = (obj) => {
	console.log(obj, '---------------------');
	if (!obj.field_permissionsVal) {
		data.tabListShow = true;
		getProjectDetails(data.detailId);
		return;
	}
	let tabList = data.tabList;
	obj.field_permissionsVal.forEach((item) => {
		switch (item.name) {
			case '基础信息':
				data.jcxxImteShow = item.state != 3;
				break;
			case '客户信息':
				data.khxxItemShow = item.state != 3;
				break;
			case '客户联系人':
				data.khlxrItemShow = item.state != 3;
				break;
			case '勘场信息':
				data.kcxxItemShow = item.state != 3;
				break;
			case '项目设计图':
				data.xmsjtItemShow = item.state != 3;
				break;
			case '报价信息':
				data.bjxxItemShow = item.state != 3;
				break;
			case '增减项信息':
				data.zjxxxItemShow = item.state != 3;
				break;
			case '合同信息':
				data.htxxItemShow = item.state != 3;
				break;
			case '施工信息':
				data.sgxxItemShow = item.state != 3;
				break;
			case '施工日志':
				data.sgrzImteShow = item.state != 3;
				break;
			case '收款信息':
				data.skxxImteShow = item.state != 3;
				break;
			case '结算信息':
				data.jsxxImteShow = item.state != 3;
				break;
			case '维保信息':
				data.wbxxImteShow = item.state != 3;
				break;
			case '维保记录':
				data.wbjlImteShow = item.state != 3;
				break;
			default:
		}
	});
	let arr = [];
	tabList.forEach((item, index) => {
		switch (item.name) {
			case '基础信息':
				if (data.jcxxImteShow) {
					arr.push(item);
				}
				break;
			case '客户信息':
				if (data.khxxItemShow || data.khlxrItemShow) {
					arr.push(item);
				}
				break;
			case '勘场信息':
				if (data.kcxxItemShow || data.xmsjtItemShow) {
					arr.push(item);
				}
				break;
			case '报价信息':
				if (data.bjxxItemShow || data.zjxxxItemShow) {
					arr.push(item);
				}
				break;
			case '合同信息':
				if (data.htxxItemShow) {
					arr.push(item);
				}
				break;
			case '施工信息':
				if (data.sgxxItemShow || data.sgrzImteShow) {
					arr.push(item);
				}
				break;
			case '收款信息':
				if (data.skxxImteShow) {
					arr.push(item);
				}
				break;
			case '结算信息':
				if (data.jsxxImteShow) {
					arr.push(item);
				}
				break;
			case '维保信息':
				if (data.wbxxImteShow || data.wbjlImteShow) {
					arr.push(item);
				}
				break;
			default:
		}
	});
	data.tabList = arr;
	console.log(arr, '11111111111111111111');
	data.tabListShow = true;
	if (arr[0].id == 0) {
		getProjectDetails(data.detailId);
	} else {
		tabActiveFunc({ index: 0 });
	}
};
// 判断是否显示
const fieldShowFunc = (field) => {
	return data.field_permissions[field] == undefined ? true : data.field_permissions[field];
};
let fileObj = ref('');
const preFileFunc = (file) => {
	console.log(file);
	fileObj.value = file;
};
const onFileSuccess = () => {
	fileObj.value = '';
};
</script>

<style lang="scss" scoped>
@import './index.scss';
</style>
